package com.mz.ozy.activity.c2c;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;

import com.mz.ozy.R;
import com.mz.ozy.base.BaseActivity;
import com.mz.ozy.bean.BalanceDetailBean;
import com.mz.ozy.bean.BankListFBean;
import com.mz.ozy.bean.ReceiveAccountBean;
import com.mz.ozy.mvp.presenter.ReceiveAccountPresenter;
import com.mz.ozy.mvp.view.ReceiveAccountContract;

import org.json.JSONObject;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class C2cSettingActivity extends BaseActivity<ReceiveAccountContract.View, ReceiveAccountPresenter> implements ReceiveAccountContract.View {

    private boolean isSave = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_c2c_setting);
        ButterKnife.bind(this);
        initTitle();
        tvCenterTitle.setText("C2C设置");
        tvBack.setImageResource(R.mipmap.back);
    }

    @OnClick({R.id.rl_sell_integral, R.id.rl_sell_my, R.id.rl_receive_account})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.rl_sell_integral:
                Intent intent0 = new Intent(this, SellOutActivity.class);
                startActivity(intent0);
                break;
            case R.id.rl_sell_my:
               /* Intent intent1 = new Intent(this, MySellKtActivity.class);
                startActivity(intent1);*/
                break;
            case R.id.rl_receive_account:

                mPresenter.queryAccount(this);

                break;
        }
    }

    @Override
    public void saveAccountSuccess(BalanceDetailBean bean) {

    }

    @Override
    public void queryAccountSuccess(ReceiveAccountBean bean) {
        if (!TextUtils.isEmpty(bean.getUsername())) {
            Intent intent2 = new Intent(this, CurAccountActivity.class);
            startActivity(intent2);
        } else {
            Intent intent2 = new Intent(this, ReceiveAccountActivity.class);
            startActivity(intent2);
        }
    }

    @Override
    public void onGetBankSuccess(BankListFBean o) {

    }

    @Override
    public void bindInfo(JSONObject bean) {

    }
}
